#!/bin/bash
if [ $# -lt 2 ]
then
	echo "请指定两个数值参数"
else
	sum=0
	if [ $1 -lt $2 ]
	then
		for ((i=$1;i<=$2;i++))
		do
			sum=$[ $sum + $i ]	
		done
	elif [ $2 -lt $1 ]
	then
		sum=0
		for ((i=$2;i<=$1;i++))
		do
			sum=$[$sum + $i]
		done
	else
		sum=$1
	fi
	echo "总和为：$sum"
fi



